package com.smdk.dsminio.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smdk.dsminio.dao.DsminioUserInfoMapper;
import com.smdk.dsminio.entity.DsminioUserInfo;
import com.smdk.dsminio.service.DsminioUserInfoService;
import org.springframework.stereotype.Service;

/**
 * (DsminioUserInfo)表服务实现类
 *
 * @author 神秘的凯
 * @since 2020-10-28 15:23:03
 */
@Service
public class DsminioUserInfoServiceImpl extends ServiceImpl<DsminioUserInfoMapper, DsminioUserInfo> implements DsminioUserInfoService {

    @Override
    public boolean addUserInfo(DsminioUserInfo userinfo) {
            return this.save(userinfo);
    }

    @Override
    public boolean deleteUserInfo(Long userId) {
        return this.removeById(userId);
    }

    @Override
    public boolean updateUserInfo(DsminioUserInfo userinfo) {
        return this.updateById(userinfo);
    }

    @Override
    public DsminioUserInfo userLogin(String userName, String userPassword) {
        QueryWrapper queryWrapper =new QueryWrapper();
        queryWrapper.eq("userName",userName);
        queryWrapper.eq("userPassword", userPassword);
        return this.getOne(queryWrapper);
    }

    @Override
    public DsminioUserInfo getUserInfo(Long userId) {
        return this.getById(userId);
    }
}